----------------------
-- Weapons
----------------------
Weapon = {}
Weapon.__index = Weapon

function Weapon.new(name, power, element, attribute, acquired, description)
    local w = {}
    setmetatable(w, Weapon)
    
    -- variables
    w.type = "weapon"
    w.name = name
    w.power = power
    w.element = element
    w.attribute = attribute
    w.acquired = acquired
    w.description = description
    
    return w
end

function getWeapons()
    local weapons = {}
    table.insert(weapons, Weapon.new("Wooden Sword", 1, "earth", "", true, "Made from old wood.\nVery weak weapon."))
    table.insert(weapons, Weapon.new("Iron Blade", 3, "", "", true, ""))
    table.insert(weapons, Weapon.new("Steel Sword", 5, "", "", true, ""))
    table.insert(weapons, Weapon.new("Fame Dagger", 9, "", "", true, ""))
    table.insert(weapons, Weapon.new("Frost Blade", 16, "", "", true, ""))
    table.insert(weapons, Weapon.new("Deathbringer", 16, "", "", true, ""))
    table.insert(weapons, Weapon.new("Deathbringer 2", 16, "", "", true, ""))
    table.insert(weapons, Weapon.new("Deathbringer 3", 16, "", "", true, ""))
    table.insert(weapons, Weapon.new("Deathbringer 4", 16, "", "", true, ""))
    table.insert(weapons, Weapon.new("Deathbringer 5", 16, "", "", true, ""))
    table.insert(weapons, Weapon.new("Ultimate Weapon", 100, "Light", "InstaKill", true, "godlike"))
    
    return weapons
end

----------------------
-- Armors
----------------------
Armor = {}
Armor.__index = Armor

function Armor.new(name, defense, element, attribute, acquired, description)
    local w = {}
    setmetatable(w, Armor)
    
    -- variables
    w.type = "armor"
    w.name = name
    w.defense = defense
    w.element = element
    w.attribute = attribute
    w.acquired = acquired
    w.description = description
    
    return w
end

function getArmors()
    local armors = {}
    table.insert(armors, Armor.new("Travel Clothes", 1, "none", "none", true, "Old clothes"))
    table.insert(armors, Armor.new("Bronze Plate", 3, "none", "none", false, "Fancy plate"))
    
    return armors
end

----------------------
-- Accessories
----------------------
Accessory = {}
Accessory.__index = Accessory

function Accessory.new(name, power, defense, element, attribute, acquired, description)
    local w = {}
    setmetatable(w, Accessory)
    
    -- variables
    w.type = "accessory"
    w.name = name
    w.power = power
    w.defense = defense
    w.element = element
    w.attribute = attribute
    w.acquired = acquired
    w.description = description
    
    return w
end

function getAccessories()
    local accessories = {}
    table.insert(accessories, Accessory.new("Ribbon", 1, 2, "none", "none", true, "godlike ribbon"))
    table.insert(accessories, Accessory.new("Ribbon 2", 3, 4, "none", "none", false, "Something better"))
    
    return accessories
end

----------------------
-- Magics
----------------------
Magic = {}
Magic.__index = Magic

function Magic.new(name, acquired, description)
    local w = {}
    setmetatable(w, Magic)
    
    -- variables
    w.type = "magic"
    w.name = name
    w.acquired = acquired
    w.description = description
    w.icon = Sprite.new()
    
    w.icon:loadImage("icon", "content/gui/icon-cure.png")
    
    return w
end

function getMagics()
    local magics = {}
    table.insert(magics, Magic.new("Cure", true, "godlike magic"))
    table.insert(magics, Magic.new("Heal", true, "godless magic"))
    
    return magics
end